package com.graduationdesign.zengyan.graduationdesignapp.dataLayer.dataBase;

import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;

import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.User;

import java.util.Date;


/**
 * Created by ZengYan on 2018/5/12.
 *
 * @desc :
 */

@Entity
public class RecentlyUsed {

    @PrimaryKey(autoGenerate = true)
    private int id;

    @ColumnInfo(name = "user_name")
    private String name;

    @ColumnInfo(name = "user_stunum")
    private String stuNum;

    @ColumnInfo(name = "user_short_phone")
    private String shortPhone;

    @ColumnInfo(name = "user_phone")
    private String longPhone;

    @ColumnInfo(name = "user_desc")
    private String desc;

    @ColumnInfo(name = "user_avatar")
    private String avatar;

    @ColumnInfo(name = "used_time")
    private Long usedTime;


    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStuNum() {
        return stuNum;
    }

    public void setStuNum(String stuNum) {
        this.stuNum = stuNum;
    }

    public String getShortPhone() {
        return shortPhone;
    }

    public void setShortPhone(String shortPhone) {
        this.shortPhone = shortPhone;
    }

    public String getLongPhone() {
        return longPhone;
    }

    public void setLongPhone(String longPhone) {
        this.longPhone = longPhone;
    }

    public Long getUsedTime() {
        return usedTime;
    }

    public void setUsedTime(Long usedTime) {
        this.usedTime = usedTime;
    }

    public void setUser(User user) {
        setShortPhone(user.getShortPhone());
        setLongPhone(user.getPhone());
        setName(user.getName());
        setStuNum(user.getStudentNum());
        setAvatar(user.getAvatarUrl());
        setDesc(user.getDescription());
        Date date=new Date();
        setUsedTime(date.getTime());
    }
}
